package com.qingcloud.adminbackend.entity.aline;


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 室内空气质量参数校准页面查询返回对象
 */
@Data
public class AlinePageAitectVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "Id", example = "11")
    private String id;

    @ApiModelProperty(value = "设备编号", example = "80000004")
    private String equipmentId;

    @ApiModelProperty(value = "监测因子", example = "1")
    private String factorId;

    @ApiModelProperty(value = "监测因子名称", example = "PM2.5")
    private String factorName;

    @ApiModelProperty(value = "传感器状态", example = "正常")
    private String sensorStatus;

    @ApiModelProperty(value = "传感器状态名称", example = "正常")
    private String sensorStatusName;

    @ApiModelProperty(value = "浓度范围起始值", example = "0")
    private BigDecimal startValue;

    @ApiModelProperty(value = "浓度范围终止值", example = "100")
    private BigDecimal endValue;

    @ApiModelProperty(value = "参数K", example = "0.312")
    private BigDecimal paramK;

    @ApiModelProperty(value = "参数B", example = "0.24")
    private BigDecimal paramB;

    @ApiModelProperty(value = "指令下发标识(0查询，1下发)", example = "0")
    private Integer operateFlag;

    @ApiModelProperty(value = "指令下发标识名称(查询，下发)", example = "查询")
    private String operateFlagName;

    @ApiModelProperty(value = "操作结果", example = "1")
    private Integer operateStatus;

    @ApiModelProperty(value = "操作结果名称", example = "成功")
    private String operateStatusName;

    @ApiModelProperty(value = "操作时间", example = "2019-04-12 14:23:12")
    private String operateTime;

    @ApiModelProperty(value = "设备工作模式", example = "1")
    private Integer workMode;

    @ApiModelProperty(value = "是否设备管理权限(0无，1有)", example = "1")
    private Integer manageAuth;

    @ApiModelProperty(value = "是否设备读权限(0无，1有)", example = "1")
    private Integer readAuth;

    public BigDecimal getStartValue() {
        if(startValue != null){
            return new BigDecimal(startValue.stripTrailingZeros().toPlainString());
        }
        return null;
    }

    public BigDecimal getEndValue() {
        if(endValue != null){
            return new BigDecimal(endValue.stripTrailingZeros().toPlainString());
        }
        return null;
    }

    public BigDecimal getParamK() {
        if(paramK != null){
            return new BigDecimal(paramK.stripTrailingZeros().toPlainString());
        }
        return null;
    }

    public BigDecimal getParamB() {
        if(paramB != null){
            return new BigDecimal(paramB.stripTrailingZeros().toPlainString());
        }
        return null;
    }
}
